#include "stdio.h"

void quicker(int a[], int left, int right)
{
	if (left < right)
	{
		int i = left;
		int j = right;
		int temp = a[i];
		while (i < j)
		{
			while (a[j] >= temp && j > i)
			{
				j--;
			}
			while (a[i] <= temp && i < j)
			{
				i++;
			}
			int n;
			n = a[i];
			a[i] = a[j];
			a[j] = n;
		}
		a[left] = a[i];
		a[i] = temp;
		quicker(a, left, i - 1);
		quicker(a, i + 1, right);
	}
}

void quicker_test()
{

	int a[] = {10, 4, 3, 10, 8, 14, 13, 7, 30, 26, 17};
	quicker(a, 1, a[0]);
	for (int i = 1; i <= a[0]; i++)
		printf("%3d", a[i]);
	printf("\n");
}
